// pages/ranking-list/ranking-list.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    rankinglist:["官方","精选","曲风","全球","MV","特色"],
    surge:[],
    new:[],
    sift:[{"name":"黑胶VIP爱听榜qqqqqqqqqqqqqqqqqqqqqqqqq","image":"http://192.168.0.26:8081/img/song-list-1.jpg","title":"新上线"},{"name":"K歌榜","image":"http://192.168.0.26:8081/img/song-list-4.jpg","title":"每日更新"},{"name":"黑胶VIP爱听榜","image":"http://192.168.0.26:8081/img/song-list-3.jpg","title":"新上线"}],
    musicstyle:[{"name":"云音乐电音榜","image":"http://192.168.0.26:8081/img/song-list-1.jpg","title":"每周五更新"},{"name":"云音乐ACG榜","image":"http://192.168.0.26:8081/img/song-list-4.jpg","title":"每周五更新"},{"name":"云音乐说唱榜","image":"http://192.168.0.26:8081/img/song-list-3.jpg","title":"每周五更新"},{"name":"云音乐摇滚榜","image":"http://192.168.0.26:8081/img/song-list-1.jpg","title":"每周五更新"},{"name":"云音乐民谣榜","image":"http://192.168.0.26:8081/img/song-list-4.jpg","title":"每周五更新"},{"name":"云音乐国电榜","image":"http://192.168.0.26:8081/img/song-list-3.jpg","title":"每周五更新"}]
  },
  tosurge(){
    console.log("tosurgr");
    wx.navigateTo({
      url: '../details/details?id=34',
    })
  },
  tonew(){
    console.log("tonew");
    wx.navigateTo({
      url: '../details/details?id=35',
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.request({
      url: 'http://192.168.0.26:8081/songSheet/getSongSheetById',
      method: 'get',
      data: {
        id: 34
      },
      success: (res) => {
        console.log(res.data.data);
        res.data.data.music=res.data.data.music.slice(0,3)
        res.data.data.imgUrl="http://192.168.0.26:8081"+res.data.data.imgUrl
        this.setData({
          surge: res.data.data
        })
        console.log(this.data.surge);
       
      }
    })
    wx.request({
      url: 'http://192.168.0.26:8081/songSheet/getSongSheetById',
      method: 'get',
      data: {
        id: 35
      },
      success: (res) => {
        console.log(res.data.data);
        res.data.data.music=res.data.data.music.slice(0,3)
        res.data.data.imgUrl="http://192.168.0.26:8081"+res.data.data.imgUrl
        this.setData({
          new: res.data.data
        })
        console.log(this.data.new);
       
      }
    })
  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})